home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
direct2a
/
gradient.bas
< prev
next >
Wrap
BASIC Source File
|
1999-10-19
|
1KB
|
65 lines
Attribute VB_Name = "General"
Type Colour
R As Single
G As Single
B As Single
End Type
Global S As Colour
Global E As Colour
Global Floor(64, 48) As Integer
Global Value(64, 48) As Integer
Global LevelName As String
Global Creator As String
Global Password As String
Global txtColour As String
Global Theme As String
Global Points As Integer
Global GStart As Colour
Global GEnd As Colour
Global levelnum As Integer
Global ShowDebug As Boolean
Global ShowInfo As Boolean
Type Player
X As Integer
Y As Integer
oldX As Integer
oldY As Integer
Frame As Integer
End Type
Global P1 As Player
Type ScBox
X As Integer
Y As Integer
End Type
Global SBox As ScBox
Sub Gradient(SR As Single, SG As Single, SB As Single, ER As Single, EG As Single, EB As Single, direction As Integer, where As Object)
On Error Resume Next
Dim d As Colour
d.R = (E.R - S.R) / 1536 'where.ScaleWidth
d.G = (E.G - S.G) / 1536 'where.ScaleWidth
d.B = (E.B - S.B) / 1536 'where.ScaleWidth
Dim c As Colour
c.R = S.R: c.G = S.G: c.B = S.B
For X = 0 To 1536 'where.ScaleWidth
where.Line (0, X)-Step(2048, X), RGB(c.R, c.G, c.B)
c.R = c.R + d.R
c.G = c.G + d.G
c.B = c.B + d.B
Next X
End Sub